package meterMonitor.controller;

import meterMonitor.biz.GatewayBiz;
import meterMonitor.framework.auth.AuthorityType;
import meterMonitor.framework.auth.FireAuthority;
import meterMonitor.model.Gateway;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@RequestMapping("gateway")
@RestController
public class GatewayController {

    @Autowired
    GatewayBiz gatewayBiz;

    /**
     * 网关管理页面
     *
     * @param mv
     * @return
     */
    @RequestMapping("gatewayIndex.do")
    @FireAuthority(authorityTypes = AuthorityType.Query)
    private ModelAndView index(ModelAndView mv) {
        return mv;
    }


    /**
     * 获取网关整体状态信息
     *
     * @return
     */
    @RequestMapping("getAll.do")
    public List<Gateway> getALl() {
        return gatewayBiz.getAllForIndex();
    }

}
